// import com.alibaba.druid.sql.ast.SQLObjectImpl;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

#include "SQLAlterTableAddConstraint.h"
#include "../../visitor/SQLASTVisitor.h"
#include "SQLConstraint.h"

SQLAlterTableAddConstraint::SQLAlterTableAddConstraint()
{
}

SQLAlterTableAddConstraint::SQLAlterTableAddConstraint(SQLConstraint_ptr constraint)
{
  this->setConstraint(constraint);
}

// @Override
void SQLAlterTableAddConstraint::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLAlterTableAddConstraint)))
  {
    acceptChild(visitor, constraint);
  }
  visitor->endVisit(SharedObject(SQLAlterTableAddConstraint));
}

SQLConstraint_ptr SQLAlterTableAddConstraint::getConstraint()
{
  return constraint;
}

void SQLAlterTableAddConstraint::setConstraint(SQLConstraint_ptr constraint)
{
  if (constraint != nullptr)
  {
    constraint->setParent(SharedObject(SQLAlterTableAddConstraint));
  }
  this->constraint = constraint;
}

BOOL_ptr SQLAlterTableAddConstraint::isWithNoCheck()
{
  return withNoCheck;
}

void SQLAlterTableAddConstraint::setWithNoCheck(BOOL_ptr withNoCheck)
{
  this->withNoCheck = withNoCheck;
}
